package com.cherry.plugin


import org.gradle.api.Plugin
import org.gradle.api.Project

class CustomGradlePlugin implements Plugin<Project> {

    @Override
    void apply(Project project) {
        println "hello plugin... ${project.name}"
        //project.extensions.create 方法的内部其实质是 通过 project.extensions.create() 方法来获取在 releaseInfo 闭包中定义的内容并通过反射将闭包的内容转换成一个 ReleaseInfoExtension 对象。
        project.extensions.create("releaseInfo", ReleaseInfoExtension.class)
        // 创建用于更新版本信息的 task，相当于注册task
        project.tasks.create("releaseInfoTask", ReleaseInfoTask.class)

        project.extensions.create("firUpload", FirPluginExtension.class)
        project.tasks.create("firUploadTask", FirUploadTask.class)

    }
}